package com.qf.health.controller;

import com.qf.health.domain.Things;
import com.qf.health.response.Response;
import com.qf.health.service.ThingsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("things")
@RequiredArgsConstructor
public class ThingsController {
    private final ThingsService thingsService;

    @PostMapping("addThings")
    public Response<Things> addThings(@RequestBody Things things) {
        thingsService.addThings(things);
        return Response.success();
    }
    @PostMapping("deleteThings")
    public Response<Things> deleteThings(@RequestBody Things things) {
        thingsService.deleteThings(things);
        return Response.success();
    }
    @PostMapping("selectThings")
    public Response<Things> selectById(@RequestBody Integer things) {
        thingsService.selectById(things);
        return Response.success();
    }
}
